using System;
using System.Collections.Generic;
using System.Text;

namespace AntEater.ComponentModel.BuildElements
{
    /// <summary>
    /// Specifies a property as property of a build element.
    /// </summary>
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
    public sealed class BuildElementPropertyAttribute:Attribute
    {
        private string _name;

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>The name.</value>
        public string Name
        {
            get { return _name; }
        }

        private bool _isRequired;

        /// <summary>
        /// Gets or sets a value indicating whether this <c>BuildElement</c> is required ore optional.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is required; otherwise, <c>false</c>.
        /// </value>
        public bool IsRequired
        {
            get { return _isRequired; }
        }

        private BuildElementPropertyType _type;

        /// <summary>
        /// Gets the type.
        /// </summary>
        /// <value>The type.</value>
        public BuildElementPropertyType Type {
            get { return _type; }
        }


        private bool _isDynamicElementName;

        /// <summary>
        /// Gets or sets a value indicating whether this instance is dynamic file name.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is dynamic file name; otherwise, <c>false</c>.
        /// </value>
        public bool IsDynamicElementName {
            get { return _isDynamicElementName; }
            set { _isDynamicElementName = value; }
        }


        /// <summary>
        /// Initializes a new instance of the <see cref="T:BuildElementAttributeAttribute"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="isRequired">The is required.</param>
        /// <param name="type">The type.</param>
        public BuildElementPropertyAttribute(string name, bool isRequired, BuildElementPropertyType type)
        {
            this._name = name;
            this._isRequired = isRequired;
            this._type = type;
        }
    }
}
